<link rel="stylesheet" type="text/css" href="css/register.css" />

<?php
if (session_status() == PHP_SESSION_NONE) {
	session_start();
}

if(isset($_SESSION['manager'])){
	echo "You have already logged. <a href='?page=selectteam'>Look at your squad</a>.";
}
else {
	

include "../Controller/RegisterController.php";
?>
<form action='?page=Register' method='post'>
	<table id='regTable'>
		<tr><th id='thReg'>Register</th></tr>
		<tr>
			<td id='inputTag'>Manager Name:</td>
			<td id='input'><input type='text' name='name' id='input'
				value="<?php echo $manager->getName(); ?>"></td>
			<td id='regError'><?php if($validationName) echo "Please enter name!"; 
			if($managerNameExists) echo "This name is not available! Please, enter another!";
			?>
			</td>
		</tr>
		<tr>
			<td id='inputTag'>Enter password:</td>
			<td ><input type='password' name='password' id='input'></td>
			<td id='regError'><?php if($validationPassword) echo "Please enter correct password!"; ?>
			</td>
		</tr>
		<tr>
			<td id='inputTag'>Repeat password:</td>
			<td id='input'><input type='password' name='repeatpassword' id='input'>
			</td>
			<td id='regError'><?php if($validationRepeatPassword) echo "Passwords don't match!"; ?>
			</td>
		</tr>
		<tr>
			<td id='inputTag'>Enter email:</td>
			<td id='input'><input type='text' name='email' id='input'
				value="<?php echo $manager->getEmail(); ?>"></td>
			<td id='regError'><?php if($validationEmail) echo "Please enter valid email address!"; 
			if($managerEmailExists) echo "This email is not available! Please, enter another!";
			?>
			</td>
		</tr>
		<tr>
			<td id='inputTag'>Choose team name: &nbsp;</td>
			<td id='input'><input type='text' name='team' id='input'
				value="<?php echo $team->getTeamName(); ?>"></td>
			<td id='regError'><?php if($validationTeam) echo "Please enter team name!"; 
			if($teamNameExists) echo "This name is not available! Please, enter antoher!";
			?>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input type='submit' name='register' id='regButton' value='Register'></td>
		</tr>
	</table>
</form>
<?php } ?>
			